<template>
	<div></div>
</template>

<script>
	import axios from 'axios'
	export default{
		name:'Cont_2',
		data(){
			return{
				text:'',
				city:'深圳',
				cityId:'',
			}
		},
		methods:{
			getText:function(){
				//获取城市Id
				axios.get('https://geoapi.qweather.com/v2/city/lookup?location='+this.city+'&key=db41eb05d781412d8f8a1369fc236f4f')
				.then((res)=>{
					// console.log("城市Id"+res.data.location[0].id)
					this.cityId=res.data.location[0].id
				}).catch((err)=>{
					console.log(err)
				})
				
				axios.get('https://devapi.qweather.com/v7/weather/now?location=101010100&key=db41eb05d781412d8f8a1369fc236f4f')
				.then((res)=>{
					// console.log(res.data.now)
				}).catch((err)=>{
					console.log(err)
				})
			}
		},
		mounted(){
			this.getText()
		}
	}
</script>

<style>
</style>
